#include "D3D9_PCH.h"
#include "D3D9CameraOrtho.h"


CD3DCameraOrtho::CD3DCameraOrtho( const CD3DWorld* pSubject )
	: CD3DCamera( pSubject )
{
	setProjection( 400.f, 300.f, 1.f, 100.f );
}


CD3DCameraOrtho::~CD3DCameraOrtho(void)
{
}

void CD3DCameraOrtho::setProjection( FLOAT fWidth, FLOAT fHeight, FLOAT fNear, FLOAT fFar ) {
	
	m_fWidth = fWidth;
	m_fHeight = fHeight;
	m_fNear = fNear;
	m_fFar = fFar;

	computeProjectionMatrix();
}

void CD3DCameraOrtho::setWidth( FLOAT fWidth ) {
	m_fWidth = fWidth;
	computeProjectionMatrix();
}

void CD3DCameraOrtho::setHeight( FLOAT fHeight ) {
	m_fHeight = fHeight;
	computeProjectionMatrix();
}

void CD3DCameraOrtho::computeProjectionMatrix() {
	
	D3DXMatrixOrthoLH( &m_matProjection, m_fWidth, m_fHeight, m_fNear, m_fFar );
}